<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<table class="its">
<thead>
	<tr>
		<th>名称</th>
		<th>电话</th>
		<th>地址</th>
		<th>操作</th>
	</tr>
</thead>
<c:forEach items="${pag.list}" var="person">
<tbody>
	<tr>
		<td>${person.name }</td>
		<td>${person.tel }</td>
		<td>${person.address }</td>
		<td><a href="javascript:void(0)" onclick="edit('${person.id }')">修改</a>
		<a href="javascript:void(0)" onclick="del('${person.id }')">删除</a></td>
	</tr>
</tbody>
</c:forEach>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td align="center" class="pn-sp">
			共 ${pag.count} 条&nbsp; 每页
			<input type="text" value="${pag.pageSize}" style="width:30px"
				onfocus="this.select();"
				onblur="$.cookie('_cookie_page_size',this.value,{expires:3650});"
				onkeypress="if(event.keyCode==13){$(this).blur();return false;}" />
			条&nbsp;
			<input type="button" value="首 页" id="goFirst" <c:if test="${pag.firstPage}"><c:out value="disabled='disabled'"></c:out></c:if>/>
			<input type="button" value="上一页" id="goPre" <c:if test="${pag.firstPage}"><c:out value="disabled='disabled'"></c:out></c:if>/>
			<input type="button" value="下一页" id="goNext" <c:if test="${pag.lastPage}"><c:out value="disabled='disabled'"></c:out></c:if>/>
			<input type="button" value="尾 页" id="goLast" <c:if test="${pag.lastPage}"><c:out value="disabled='disabled'"></c:out></c:if>/>
			&nbsp; 当前 ${pag.pageNo}/${pag.totalPage} 页 &nbsp;转到第
			<input type="text" id="_goPs" style="width:50px"
				value="${value.pageNo}" onfocus="this.select();"
				onkeypress="if(event.keyCode==13){$('#_goPage').click();return false;}" />
			页
			<input id="_goPage" type="button" value="转" <c:if test="${pag.totalPage==1}"><c:out value="disabled='disabled'"></c:out></c:if>/>
		</td>
	</tr>
</table>
<script type="text/javascript">
$("#goNext").bind("click",function(){$("#result").pager({pageNo:${pag.nextPage},pageCount:${pag.count},objId:this.id});});
$("#goPre").bind("click",function(){$("#result").pager({pageNo:${pag.prePage},pageCount:${pag.count},objId:this.id});});
$("#goFirst").bind("click",function(){$("#result").pager({pageNo:1,pageCount:${pag.count},objId:this.id});});
$("#goLast").bind("click",function(){$("#result").pager({pageNo:${pag.totalPage},pageCount:${pag.count},objId:this.id});});
$("#_goPage").bind("click",function(){ var pageNo = $("#_goPs").val(); var pattern=/^\d*$/;if(!pattern.test(pageNo) || parseInt(pageNo)<1){Cms.alert("请输入大于0的整数");return;	}if(parseInt(pageNo)>${pag.count}){ Cms.alert("请输入小于${pag.count+1}的整数"); return; }  $("#result").pager({pageNo:pageNo,pageCount:${pag.count},objId:'_goPage'}); });
 </script>
